package com.ruoyi.project.system.domain.vo;

import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.project.system.domain.SysProduct;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;

@NoArgsConstructor
@Data
public class PromoteEquity {

    private int productId;

    private String productType;

    private String productName;

    /**
     * 本人代理提成
     */
    private BigDecimal royalty;

    private BigDecimal maxRoyalty;

    /**
     * 本人佣金
     */
    private BigDecimal brokerage;

    private BigDecimal maxBrokerage;

    /** 红包机会次数 */
    @Excel(name = "红包机会次数")
    private Integer redPacketNum;

    /**
     * V0等级系统底价
     */
    private BigDecimal v0Pricing;

    /**
     * V1等级系统底价
     */
    private BigDecimal v1Pricing;

    /**
     * V2等级系统底价
     */
    private BigDecimal v2Pricing;

    /**
     * V3等级系统底价
     */

    private BigDecimal v3Pricing;

    /**
     * V4等级系统底价
     */
    private BigDecimal v4Pricing;

    /**
     * V5等级系统底价
     */
    private BigDecimal v5Pricing;

    private BigDecimal sj_royalty;

    private BigDecimal chouRui;

    /**
     * 系统底价
     */
    private BigDecimal customizedPrice;

    public PromoteEquity(SysProduct sysProduct, BigDecimal sysFloorPrice, BigDecimal sj_royalty , BigDecimal chouRui) {
        this.productId = sysProduct.getProductId();
        this.productType = sysProduct.getProductType();
        this.productName = sysProduct.getProductName();
        this.redPacketNum = sysProduct.getRedPacketNum();

        this.v0Pricing = sysProduct.getV0Pricing().add(sj_royalty);
        this.v1Pricing = sysProduct.getV1Pricing().add(sj_royalty);
        this.v2Pricing = sysProduct.getV2Pricing().add(sj_royalty);
        this.v3Pricing = sysProduct.getV3Pricing().add(sj_royalty);
        this.v4Pricing = sysProduct.getV4Pricing().add(sj_royalty);
        this.v5Pricing = sysProduct.getV5Pricing().add(sj_royalty);

        this.royalty = sysProduct.getRoyalty();
        this.brokerage = sysProduct.getBrokerage();
        this.maxRoyalty = sysProduct.getMaxRoyalty();
        this.maxBrokerage = sysProduct.getMaxBrokerage();

        this.sj_royalty = sj_royalty;
        this.chouRui = chouRui;
        this.customizedPrice = sysFloorPrice == null ? null : sysFloorPrice.add(sj_royalty);
    }

}
